package com.example.express;

import android.view.animation.AlphaAnimation;
import android.view.animation.AnimationUtils;
import android.widget.ImageView;

import com.example.express.base.BaseActivity;

import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ScheduledThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

public class WelcomeActivity extends BaseActivity {

    public final ScheduledExecutorService executorService = new ScheduledThreadPoolExecutor(1);


    @Override
    protected int initLayout() {
        return R.layout.activity_welcome;
    }

    @Override
    protected void initData() {

    }

    @Override
    protected void initView() {
        ImageView imageView = findViewById(R.id.img);
        AlphaAnimation animation = (AlphaAnimation) AnimationUtils
                .loadAnimation(this, R.anim.alpha_anim);
        imageView.setAnimation(animation);
        imageView.startAnimation(animation);
        executorService.schedule(new Runnable() {
            @Override
            public void run() {
                MainActivity.start(WelcomeActivity.this);
                finish();
            }
        },3000, TimeUnit.MILLISECONDS);
    }

}